package huas.ant.mapper;

import com.github.pagehelper.Page;
import huas.ant.entity.Coach;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CoachMapper {
    /**
     * 分页列表查询
     */
    @Select("select * from coach")
    Page<Coach> page();
    /**
     * 添加教练
     */
    @Insert("insert into coach (name, gender, age, entry_time, staff, message) VALUES " +
            "(#{name},#{gender},#{age},#{entryTime},#{staff},#{message})")
    void insert(Coach coach);
    /**
     * 根据教练ID查询设备信息
     */
    @Select("select * from coach where id = #{id}")
    Coach findById(Integer id);
    /**
     * 修改教练信息
     */
    void update(Coach coach);
    /**
     * 删除教练信息
     */
    @Delete("delete from coach where id = #{id}")
    void delete(Integer id);
}
